<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>experimental::parallel_group::async_wait</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../index.html" title="Asio">
<link rel="up" href="../experimental__parallel_group.html" title="experimental::parallel_group">
<link rel="prev" href="../experimental__parallel_group.html" title="experimental::parallel_group">
<link rel="next" href="parallel_group.html" title="experimental::parallel_group::parallel_group">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../../asio.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../experimental__parallel_group.html"><img src="../../../prev.png" alt="Prev"></a><a accesskey="u" href="../experimental__parallel_group.html"><img src="../../../up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../home.png" alt="Home"></a><a accesskey="n" href="parallel_group.html"><img src="../../../next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="asio.reference.experimental__parallel_group.async_wait"></a><a class="link" href="async_wait.html" title="experimental::parallel_group::async_wait">experimental::parallel_group::async_wait</a>
</h4></div></div></div>
<p>
          <a class="indexterm" name="asio.indexterm.experimental__parallel_group.async_wait"></a> 
Initiate
          an asynchronous wait for the group of operations.
        </p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span>
    <span class="keyword">typename</span> <span class="identifier">CancellationCondition</span><span class="special">,</span>
    <span class="keyword">typename</span> <span class="identifier">CompletionToken</span><span class="special">&gt;</span>
<span class="keyword">auto</span> <span class="identifier">async_wait</span><span class="special">(</span>
    <span class="identifier">CancellationCondition</span> <span class="identifier">cancellation_condition</span><span class="special">,</span>
    <span class="identifier">CompletionToken</span> <span class="special">&amp;&amp;</span> <span class="identifier">token</span><span class="special">);</span>
</pre>
<p>
          Launches the group and asynchronously waits for completion.
        </p>
<h6>
<a name="asio.reference.experimental__parallel_group.async_wait.h0"></a>
          <span><a name="asio.reference.experimental__parallel_group.async_wait.parameters"></a></span><a class="link" href="async_wait.html#asio.reference.experimental__parallel_group.async_wait.parameters">Parameters</a>
        </h6>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">cancellation_condition</span></dt>
<dd><p>
                A function object, called on completion of an operation within the
                group, that is used to determine whether to cancel the remaining
                operations. The function object is passed the arguments of the completed
                operation's handler. To trigger cancellation of the remaining operations,
                it must return a <a class="link" href="../cancellation_type.html" title="cancellation_type"><code class="computeroutput"><span class="identifier">cancellation_type</span></code></a> value
                other than <code class="computeroutput"><span class="identifier">asio</span><span class="special">::</span><span class="identifier">cancellation_type</span><span class="special">::</span><span class="identifier">none</span></code>.
              </p></dd>
<dt><span class="term">token</span></dt>
<dd><p>
                A completion token whose signature is comprised of a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span>
                <span class="identifier">N</span><span class="special">&gt;</span></code>
                indicating the completion order of the operations, followed by all
                operations' completion handler arguments.
              </p></dd>
</dl>
</div>
<p>
          The library provides the following <code class="computeroutput"><span class="identifier">cancellation_condition</span></code>
          types:
        </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
              <a class="link" href="../experimental__wait_for_all.html" title="experimental::wait_for_all"><code class="computeroutput"><span class="identifier">experimental</span><span class="special">::</span><span class="identifier">wait_for_all</span></code></a>
            </li>
<li class="listitem">
              <a class="link" href="../experimental__wait_for_one.html" title="experimental::wait_for_one"><code class="computeroutput"><span class="identifier">experimental</span><span class="special">::</span><span class="identifier">wait_for_one</span></code></a>
            </li>
<li class="listitem">
              <a class="link" href="../experimental__wait_for_one_error.html" title="experimental::wait_for_one_error"><code class="computeroutput"><span class="identifier">experimental</span><span class="special">::</span><span class="identifier">wait_for_one_error</span></code></a>
            </li>
<li class="listitem">
              <a class="link" href="../experimental__wait_for_one_success.html" title="experimental::wait_for_one_success"><code class="computeroutput"><span class="identifier">experimental</span><span class="special">::</span><span class="identifier">wait_for_one_success</span></code></a>
            </li>
</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2003-2022 Christopher M. Kohlhoff<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../experimental__parallel_group.html"><img src="../../../prev.png" alt="Prev"></a><a accesskey="u" href="../experimental__parallel_group.html"><img src="../../../up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../home.png" alt="Home"></a><a accesskey="n" href="parallel_group.html"><img src="../../../next.png" alt="Next"></a>
</div>
</body>
</html>
